package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBaseInformationMapper;
import com.ruoyi.system.domain.TBaseInformation;
import com.ruoyi.system.service.ITBaseInformationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考生基本信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-20
 */
@Service
public class TBaseInformationServiceImpl implements ITBaseInformationService 
{
    @Autowired
    private TBaseInformationMapper tBaseInformationMapper;

    /**
     * 查询考生基本信息
     * 
     * @param baseId 考生基本信息主键
     * @return 考生基本信息
     */
    @Override
    public TBaseInformation selectTBaseInformationByBaseId(Long baseId)
    {
        return tBaseInformationMapper.selectTBaseInformationByBaseId(baseId);
    }

    /**
     * 查询考生基本信息列表
     * 
     * @param tBaseInformation 考生基本信息
     * @return 考生基本信息
     */
    @Override
    public List<TBaseInformation> selectTBaseInformationList(TBaseInformation tBaseInformation)
    {
        return tBaseInformationMapper.selectTBaseInformationList(tBaseInformation);
    }

    /**
     * 新增考生基本信息
     * 
     * @param tBaseInformation 考生基本信息
     * @return 结果
     */
    @Override
    public int insertTBaseInformation(TBaseInformation tBaseInformation)
    {
        tBaseInformation.setCreateTime(DateUtils.getNowDate());
        return tBaseInformationMapper.insertTBaseInformation(tBaseInformation);
    }

    /**
     * 修改考生基本信息
     * 
     * @param tBaseInformation 考生基本信息
     * @return 结果
     */
    @Override
    public int updateTBaseInformation(TBaseInformation tBaseInformation)
    {
        tBaseInformation.setUpdateTime(DateUtils.getNowDate());
        return tBaseInformationMapper.updateTBaseInformation(tBaseInformation);
    }

    /**
     * 批量删除考生基本信息
     * 
     * @param baseIds 需要删除的考生基本信息主键
     * @return 结果
     */
    @Override
    public int deleteTBaseInformationByBaseIds(String baseIds)
    {
        return tBaseInformationMapper.deleteTBaseInformationByBaseIds(Convert.toStrArray(baseIds));
    }

    /**
     * 删除考生基本信息信息
     * 
     * @param baseId 考生基本信息主键
     * @return 结果
     */
    @Override
    public int deleteTBaseInformationByBaseId(Long baseId)
    {
        return tBaseInformationMapper.deleteTBaseInformationByBaseId(baseId);
    }

    @Override
    public String batchGenBaseInfo() {
        StringBuilder successMsg = new StringBuilder();
        successMsg.append("<br/>" + "、准考证号 " +  " 姓名 " + " 生成成功");
        return successMsg.toString();
    }
}
